<?php

/**
 * @author Marc André Audet <root@manhim.net>
 * @copyright Copyright(c) 2009-2010 Marc André Audet
 * @version 1.0.5.24
 * @license http://www.gnu.org/licenses/gpl.txt The GNU General Public License version 3
 *
 * $Rev: 150 $
 *
 *   GStats++ DOTA Allstars Plugin, made for GStats++
 *   GStats++ http://code.google.com/gstatspp/
 *   Version consist of:
 *   [Major Version].[Number of years since 2010].[Month].[Date]
 *   The informations are based on the latest edit of this file, not the whole project.
 *
 *   Copyright (C) 2009-2010 Marc André Audet
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
class GStatsppPlugins_DOTAAllstars extends GStatsppPlugins
{

    private $Name = 'DOTA Allstars';
    private $Version = '1.0.5.24';
    private $Author = 'Marc André Audet';
    private $Maintainers = array(array('Marc André Audet', '1.0.5.23'));
    private $Link = 'http://code.google.com/p/gstatspp/';
    private $Description = "DOTA Allstars plugin for GStats++.<br />\nLink: <a href=\"http://getdota.com/\" target=\"_blank\">getdota.com</a>.<br />\nMap author: Icefrog";
	private $UpdateLink = "http://manhim.net/gstatsppupdates/dotaallstars.php";

    function CheckInstall()
    {
        $return = array(
            'PHP Version' => array(CHECK_ERROR, 0, 0, 0),
            'MPDO Class Loaded' => array(CHECK_ERROR),
            'DOTA Allstars Parser Class Loaded' => array(CHECK_ERROR),
            'Templates Class Loaded' => array(CHECK_ERROR),
        );

        if (version_compare(PHP_VERSION, '5.2.0') >= 0)
        {
            $return['PHP Version'] = array(CHECK_OK, '5.2.0', '5.1.0', PHP_VERSION);
        }
        else if (version_compare(PHP_VERSION, '5.1.0') >= 0)
        {
            $return['PHP Version'] = array(CHECK_WARNING, '5.2.0', '5.1.0', PHP_VERSION);
        }
        else
        {
            $return['PHP Version'] = array(CHECK_ERROR, '5.2.0', '5.1.0', PHP_VERSION);
        }

        if (class_exists('MPDO') && class_exists('MPDOQuery'))
        {
            $return['MPDO Class Loaded'] = array(CHECK_OK);
        }
        else
        {
            $return['MPDO Class Loaded'] = array(CHECK_ERROR);
        }

        if (class_exists('DOTAAllstarsParser'))
        {
            $return['DOTA Allstars Parser Class Loaded'] = array(CHECK_OK);
        }
        else
        {
            $return['DOTA Allstars Parser Class Loaded'] = array(CHECK_ERROR);
        }

        if (class_exists('Templates'))
        {
            $return['Templates Class Loaded'] = array(CHECK_OK);
        }
        else
        {
            $return['Templates Class Loaded'] = array(CHECK_ERROR);
        }

        return $return;
    }

    function Install()
    {
        parent::Install();
    }

    function CheckUpdate()
    {
        parent::CheckUpdate();
    }

    function Update()
    {
        parent::Update();
    }

    function Remove()
    {
        parent::Remove();
    }

    function RunTranslator()
    {
        parent::RunTranslator();
    }

    function RunCommunicator()
    {
        parent::RunCommunicator();
    }

    function RunInterface()
    {
        parent::RunInterface();
    }

    function AjaxCall($call, $data = array())
    {
        parent::AjaxCall();
    }

    function Language($name, $locale)
    {
        switch ($locale)
        {
            case 'en': default:
                switch ($name)
                {
                    case 'PHP Version': return 'PHP Version';
                    case 'MPDO Class Loaded': return 'MPDO Class Loaded';
                    case 'DOTA Allstars Parser Class Loaded': return 'DOTA Allstars Parser Class Loaded';
                    case 'Templates Class Loaded': return 'Templates Class Loaded';

                    case 'Games': return 'Games';
                    case 'Players': return 'Players';
                    case 'Top 20 Players': return 'Top 20 Players';
                }
                break;
        }
    }

    function GetMenu()
    {
        return array(
            'Games' => 'Games',
            'Players' => 'Players',
            'Top20Players' => 'Top 20 Players'
        );
    }

}

?>
